﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OutdoorLib.BaseEntity;
using Grishko.SerilizeTools;
using System.ComponentModel;


namespace OutdoorLib.BaseEntity
{
    public class Face_F : FaceEntity 
    {

       [DefaultValue("")] 
       public string FirstName { get  ;  set ;  }

       [DefaultValue("")]
       public string SecondName { get; set; }

       [DefaultValue("")]
       public string LastName { get; set; }


       [SrchItemInfo(TxtPropertyName = "ФИО")]       
       public string FullName
       {
           get
           {
               return FirstName + " " + SecondName + " " + LastName;
           }
       }

       [EntityNonSerialized]
       public string ShortFullName
       {
           get
           {
               if (string.IsNullOrEmpty(FirstName))
                                    return string.Empty;

               return FirstName + " " + (string.IsNullOrEmpty (SecondName)?"":SecondName.Substring (0,1)) + " " + (string.IsNullOrEmpty (LastName)?"":LastName.Substring (0,1));
           }
       }

       [EntityNonSerialized]
       public string ShortName
       {
           get
           {
               return FirstName + " " + (SecondName.Length > 0 ? SecondName.Substring(0, 1) : "") + " " + (string.IsNullOrEmpty(LastName) ? "" : LastName.Substring(0, 1));
           }
       }

       [SrchItemInfo(TxtPropertyName = "Дата рождения")]        
       public DateTime BirthDay { get; set; } 


      
    }
}
                                                                                